package com.itheima.controller;

import com.itheima.pojo.Result;
import com.itheima.pojo.StudentOption;
import com.itheima.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/report")
public class Report02Controller {
    @Autowired
    private StudentService studentService;
    //统计学员学历
    @GetMapping("/studentDegreeData")
    public Result stuentDegreeDate(){
        List<Map<String, Object>> studentList = studentService.stuentDegreeDate();
    return Result.success(studentList);
    }

    //统计班级人数
    @GetMapping("/studentCountData")
    public Result studentCountData(){
    StudentOption studentOption = studentService.studentCountData();
    return Result.success(studentOption);
    }
}
